<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            perspective: 500px;
        }
        .box {
            position: relative;
            width: 200px;
            height: 200px;
            margin: 100px  auto;
            transition: all 2s;
            /* transform-style: flat;------子元素不开启3d立体空间 */
            /* transform-style: preserve-3d; -----子元素开启3d立体空间 */
            /* 代码写给父级元素，但影响的是子盒子 */
            transform-style: preserve-3d;
        }
        .box:hover {
            transform: rotateY(90deg);
        }
        .box img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }
        .box img:last-child {
            transform: rotate3d(1,1,0,90deg);

        }
    </style>
</head>
<body>
    <div class="box">
        <img src="images/图层1.png" alt="">
        <img src="images/图层2.png" alt="">
    </div>
</body>
</html>